﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Database;
public partial class admin_HienthichitietDDH : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        var pm = new checkLogin();
        pm.redirectToLoginPage();
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
    protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
         if (Convert.ToString(e.CommandArgument) == "dk")
            {
                CT_DonDatHang ctddh = new CT_DonDatHang();
                int maddh = Convert.ToInt32(((HyperLink)e.Item.FindControl("hplmaddh")).Text);
                int mamay = Convert.ToInt32(((HyperLink)e.Item.FindControl("hplmamay")).Text);
                ctddh.XoaCTDDH(maddh,mamay);
                LayDuLieu(maddh);
             Response.Redirect("HienthichitietDDH.aspx");

            }
            else
            {
                int maddh = Convert.ToInt32(((HyperLink)e.Item.FindControl("hplmaddh")).Text);
                int mamay = Convert.ToInt32(((HyperLink)e.Item.FindControl("hplmamay")).Text);
                LayDuLieu(maddh);
            }
        }


    public void LayDuLieu(int maddh)
    {
        PagedDataSource pgitems = new PagedDataSource();
        DataView dv = new DataView(CT_DonDatHang.CTDDHTheoMa(maddh).Tables[0]);

    }

    
}
